<template>
  <div>
    <!-- 评价的头部 -->
    <div class="shangpin">
      <van-icon name="arrow-left" @click="chan" />
    </div>
    <!-- 详情 -->
    <div class="info">
      <van-row>
        <van-col span="12">客户</van-col>
        <van-col class="span12" span="12">{{ item.cusName }}</van-col>
      </van-row>
      <van-row>
        <van-col span="12">商品</van-col>
        <van-col class="span12" span="12">{{ item.prodName }}</van-col>
      </van-row>
      <van-row>
        <van-col span="12">数量</van-col>
        <van-col class="span12" span="12">{{ item.prodNum }}</van-col>
      </van-row>
      <van-row>
        <van-col span="12">下单人</van-col>
        <van-col class="span12" span="12">{{ item.orderUserName }}</van-col>
      </van-row>
      <van-row>
        <van-col span="12">下单时间</van-col>
        <van-col class="span12" span="12">{{ item.orderTime }}</van-col>
      </van-row>
    </div>
    <!-- 地址信息 -->
    <div class="dizhi">
      <van-row gutter="20" class="top">
        <van-col span="8">收货人</van-col>
        <van-col class="span14" span="14">{{ item.orderUserName }}</van-col>
      </van-row>
      <van-row gutter="20">
        <van-col span="8">联系电话</van-col>
        <van-col class="span14" span="14">15642318612</van-col>
      </van-row>
      <van-row gutter="20">
        <van-col span="8">收货地址</van-col>
        <van-col class="span14 spangao" span="14">{{ item.cusName }}</van-col>
      </van-row>
      <van-row gutter="20" class="bottom">
        <van-col span="8">物流单号</van-col>
        <van-col class="span14" span="14">{{ item.serialNo }}</van-col>
      </van-row>
    </div>
    <!-- 确认发货按钮 -->
    <van-button round type="info" block color="#003399" @click="isFound"
      >确认发货信息</van-button
    >
  </div>
</template>

<script>
import { NowFound } from "../request/api";
export default {
  data() {
    return {};
  },
  methods: {
    chan() {
      this.$emit("chan");
    },
    isFound() {
      let serialNo = this.item.serialNo;
      let receiver = this.item.orderUserName;
      let linkPhone = "15642318612";
      let address = this.item.cusName;
      let logisticsCode = this.item.serialNo;
      // console.log(serialNo,receiver,linkPhone,address,logisticsCode);
      // console.log(this.item);
      NowFound({
        serialNo,
        receiver,
        linkPhone,
        address,
        logisticsCode
      }).then(res => {
        if (res.errCode == "0") {
          this.$toast.success(res.message);
          setTimeout(() => {
            this.chan();
          }, 1500);
        }
      });
    }
  },
  props: ["item"]
};
</script>
 
<style lang = "less" scoped>
.shangpin {
  background-color: #003399;
  color: #fff;
  padding: 0.166667rem 0.066667rem;
}
.span12 {
  text-align: right;
  color: rgb(160, 157, 157);
}
.info {
  margin-top: 0.133333rem;
  background-color: #fff;
  .van-row {
    padding: 0.133333rem;
    border-bottom: 1px solid #eee;
  }
}
.dizhi {
  background-color: #fff;
  margin-top: 0.133333rem;
  .van-row {
    padding: 0.133333rem 0.266667rem;
    .span14 {
      width: 2.4rem;
      height: 0.333333rem;
      background-color: #eee;
      box-sizing: border-box;
      border-radius: 0.04rem;
      padding: 0.066667rem 0.266667rem;
    }
    .spangao {
      height: 1.066667rem;
    }
  }
}
.van-button {
  width: 90%;
  margin: 0.4rem auto 0;
}
</style>